import { App, Directive } from 'vue';
import download from './download';
import trim from './trim';

interface GlobalDirective {
    [key: string]: Directive;
}

const directivesObj: GlobalDirective = {
    download,
    trim,
};
/** 注册全局自定义指令 */
export default function creatGlobalDirective(app: App<Element>) {
    Object.entries(directivesObj).forEach(([key, val]) => {
        app.directive(key, val);
    });
}
